using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DevExpress.ExpressApp.DC;
using DevExpress.ExpressApp.Model;
using DevExpress.Persistent.Base;
using DevExpress.Persistent.BaseImpl;
using DevExpress.Persistent.Validation;
using DevExpress.Xpo;
namespace Ascent.QiPei.Module.BusinessObjects.Purchase
{
  [DefaultClassOptions]
  [DevExpress.Persistent.Base.NavigationItemAttribute("采购管理")]
  [DevExpress.ExpressApp.DC.XafDisplayNameAttribute("询价单")]
  public partial class Inquiry : DevExpress.Persistent.BaseImpl.BaseObject
  {
    private Ascent.QiPei.Module.BusinessObjects.Base.ShipVia _shipVia;
    private Ascent.QiPei.Module.BusinessObjects.Base.Supplier _supplier;
    private Ascent.QiPei.Module.BusinessObjects.Enums.ModeOfPaymentType _modeOfPayment;
    private System.Int16 _taxRate;
    private System.Int16 _discount;
    private System.Boolean _taxIncluded;
    private System.Single _totalAmount;
    private System.Single _taxAmount;
    private System.Single _amount;
    private System.Single _discountAmount;
    private System.String _remarks;
    private System.String _invoiceNumber;
    private System.DateTime _requiredDeliveryDate;
    private Ascent.QiPei.Module.BusinessObjects.Base.Employee _purchasePerson;
    private System.String _pOCode;
    public Inquiry(DevExpress.Xpo.Session session)
      : base(session)
    {
    }
    [DevExpress.ExpressApp.DC.XafDisplayNameAttribute("采购单")]
    [DevExpress.Persistent.Base.VisibleInListViewAttribute(false)]
    [DevExpress.Persistent.Base.VisibleInLookupListViewAttribute(false)]
    [RuleRequiredField(DefaultContexts.Save)]
    public System.String POCode
    {
      get
      {
        return _pOCode;
      }
      set
      {
        SetPropertyValue("POCode", ref _pOCode, value);
      }
    }
    [DevExpress.ExpressApp.DC.XafDisplayNameAttribute("供应商")]
    public Ascent.QiPei.Module.BusinessObjects.Base.Supplier Supplier
    {
      get
      {
        return _supplier;
      }
      set
      {
          SetPropertyValue("Supplier", ref _supplier, value);
        //if (_supplier == value)
        //  return;
        //Ascent.QiPei.Module.BusinessObjects.Base.Supplier prevSupplier = _supplier;
        //_supplier = value;
        //if (IsLoading)
        //  return;
        //if (prevSupplier != null && prevSupplier.Inquiry == this)
        //  prevSupplier.Inquiry = null;
        //if (_supplier != null)
        //  _supplier.Inquiry = this;
        //OnChanged("Supplier");
      }
    }
    [DevExpress.ExpressApp.DC.XafDisplayNameAttribute("采购员")]
    public Ascent.QiPei.Module.BusinessObjects.Base.Employee PurchasePerson
    {
      get
      {
        return _purchasePerson;
      }
      set
      {
        SetPropertyValue("PurchasePerson", ref _purchasePerson, value);
      }
    }
    [DevExpress.ExpressApp.DC.XafDisplayNameAttribute("交货日期")]
    public System.DateTime RequiredDeliveryDate
    {
      get
      {
        return _requiredDeliveryDate;
      }
      set
      {
        SetPropertyValue("RequiredDeliveryDate", ref _requiredDeliveryDate, value);
      }
    }
    [DevExpress.ExpressApp.DC.XafDisplayNameAttribute("折扣%")]
    [DevExpress.Persistent.Base.ImmediatePostDataAttribute]
    [DevExpress.Persistent.Base.VisibleInLookupListViewAttribute(false)]
    [DevExpress.Persistent.Base.VisibleInListViewAttribute(false)]
    public System.Int16 Discount
    {
      get
      {
        return _discount;
      }
      set
      {
        SetPropertyValue("Discount", ref _discount, value);
      }
    }
    [DevExpress.ExpressApp.DC.XafDisplayNameAttribute("支付方式")]
    public Ascent.QiPei.Module.BusinessObjects.Enums.ModeOfPaymentType ModeOfPayment
    {
      get
      {
        return _modeOfPayment;
      }
      set
      {
        SetPropertyValue("ModeOfPayment", ref _modeOfPayment, value);
      }
    }
    [DevExpress.Persistent.Base.ImmediatePostDataAttribute]
    [DevExpress.ExpressApp.DC.XafDisplayNameAttribute("是否含税")]
    [DevExpress.Persistent.Base.VisibleInLookupListViewAttribute(false)]
    [DevExpress.Persistent.Base.VisibleInListViewAttribute(false)]
    public System.Boolean TaxIncluded
    {
      get
      {
        return _taxIncluded;
      }
      set
      {
        SetPropertyValue("TaxIncluded", ref _taxIncluded, value);
      }
    }
    [DevExpress.ExpressApp.DC.XafDisplayNameAttribute("发票号码")]
    [DevExpress.Persistent.Base.VisibleInListViewAttribute(false)]
    [DevExpress.Persistent.Base.VisibleInLookupListViewAttribute(false)]
    public System.String InvoiceNumber
    {
      get
      {
        return _invoiceNumber;
      }
      set
      {
        SetPropertyValue("InvoiceNumber", ref _invoiceNumber, value);
      }
    }
    [DevExpress.Persistent.Base.ImmediatePostDataAttribute]
    [DevExpress.ExpressApp.DC.XafDisplayNameAttribute("税率")]
    [DevExpress.Persistent.Base.VisibleInLookupListViewAttribute(false)]
    [DevExpress.Persistent.Base.VisibleInListViewAttribute(false)]
    public System.Int16 TaxRate
    {
      get
      {
        return _taxRate;
      }
      set
      {
        SetPropertyValue("TaxRate", ref _taxRate, value);
      }
    }
    [DevExpress.ExpressApp.DC.XafDisplayNameAttribute("备注")]
    [DevExpress.Persistent.Base.VisibleInLookupListViewAttribute(false)]
    [DevExpress.Persistent.Base.VisibleInListViewAttribute(false)]
    public System.String Remarks
    {
      get
      {
        return _remarks;
      }
      set
      {
        SetPropertyValue("Remarks", ref _remarks, value);
      }
    }
    [DevExpress.ExpressApp.DC.XafDisplayNameAttribute("合计金额")]
    [DevExpress.Persistent.Base.ImmediatePostDataAttribute]
    public System.Single TotalAmount
    {
      get
      {
        return _totalAmount;
      }
      set
      {
        SetPropertyValue("TotalAmount", ref _totalAmount, value);
      }
    }
    [DevExpress.ExpressApp.DC.XafDisplayNameAttribute("折扣金额")]
    [DevExpress.Persistent.Base.ImmediatePostDataAttribute]
    public System.Single DiscountAmount
    {
      get
      {
        return _discountAmount;
      }
      set
      {
        SetPropertyValue("DiscountAmount", ref _discountAmount, value);
      }
    }
    [DevExpress.ExpressApp.DC.XafDisplayNameAttribute("税金金额")]
    [DevExpress.Persistent.Base.ImmediatePostDataAttribute]
    public System.Single TaxAmount
    {
      get
      {
        return _taxAmount;
      }
      set
      {
        SetPropertyValue("TaxAmount", ref _taxAmount, value);
      }
    }
    [DevExpress.ExpressApp.DC.XafDisplayNameAttribute("实际金额 ")]
    [DevExpress.Persistent.Base.ImmediatePostDataAttribute]
    public System.Single Amount
    {
      get
      {
        return _amount;
      }
      set
      {
        SetPropertyValue("Amount", ref _amount, value);
      }
    }
    [DevExpress.ExpressApp.DC.XafDisplayNameAttribute("运输方式")]
    public Ascent.QiPei.Module.BusinessObjects.Base.ShipVia ShipVia
    {
      get
      {
        return _shipVia;
      }
      set
      {
        SetPropertyValue("ShipVia", ref _shipVia, value);
      }
    }
    [DevExpress.Xpo.AssociationAttribute("InquiryItems-Inquiry")]
    [DevExpress.ExpressApp.DC.XafDisplayNameAttribute("明细")]
    public XPCollection<Ascent.QiPei.Module.BusinessObjects.Purchase.InquiryItems> InquiryItems
    {
      get
      {
        return GetCollection<Ascent.QiPei.Module.BusinessObjects.Purchase.InquiryItems>("InquiryItems");
      }
    }
  }
}
